﻿namespace Ki.FractalTerrains
open System;

module Utilities =
    let LayerToLetter tLayer =
        match tLayer with
        | 0 -> "A"
        | 1 -> "B"
        | 2 -> "C"
        | 3 -> "D"
        | 4 -> "E"
        | 5 -> "F"
        | _ -> "Does Not Exist"
    let private NumberToName(tIndex : int) =
        String.Format("{0:X}", tIndex)
        |> fun tValue ->
            match tValue.Length with
            | 1 -> "00" + tValue
            | 2 -> "0" + tValue
            | _ -> tValue
    let FileName tLayer tXIndex tYIndex =
        LayerToLetter(tLayer) + NumberToName(tXIndex) + NumberToName(tYIndex)
